#include <iostream>
#include <string>
using namespace std;

int main()
{
    string in, ori;
    cin >> in;
    ori = in;
    in.erase(in.end()-2);
    in.erase(5, 1);
    in.erase(1, 1);
    int ans  = 0, sum = 0;
    for (int i=0; i<9; ++i)
        sum += (in[i]-'0') * (i+1);
    ans = sum % 11;
    if (ans == 10)
    {
        if (in[9] == 'X')
            cout << "Right";
        else
        {
            ori[12] = 'X';
            cout << ori;
        }
    }
    else
    {
        if (in[9]-'0' == ans)
            cout << "Right";
        else
        {
            ori[12] = ans + '0';
            cout << ori;
        }
    }
    //cout << in;
    return 0;
}
